package com.eric.controller;

import com.alibaba.fastjson.JSON;
import com.eric.req.BasePostReq;
import com.eric.resp.BaseResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 基础控制器
 * @author: liuBing
 * @create: 2022-12-19 16:36
 **/
@RestController
@RequestMapping("baseController")
@Slf4j
@Api("基础控制器")
public class BaseController {


    @ApiOperation("post 请求基础接口")
    @PostMapping("post")
    public BaseResp<Object> post(@Validated @RequestBody BasePostReq req){
        log.info(JSON.toJSONString(req));
        return null;
    }


    @ApiOperation("get 请求基础接口")
    @GetMapping("get")
    public void get(@RequestParam String id){

    }
    @ApiOperation("delete 请求基础接口")
    @DeleteMapping("delete")
    public void delete(@RequestParam String id){
        System.out.println(id);
    }


    @ApiOperation("#{server.port}")
    @DeleteMapping("delete1")
    public void test(@RequestParam String id){
        System.out.println(id);
    }

}
